class Solution(object):
    def findKthPositive(self, arr, k):
        now = arr[0] - 1
        if now >= k:
            return k
        for i in range(1, len(arr)):
            if now + arr[i] - arr[i - 1] - 1 >= k:
                return arr[i - 1] + k - now
            else:
                now += arr[i] - arr[i - 1] - 1
        return arr[-1] + k - now

